import { createPinia } from 'pinia'
import { type App } from 'vue'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

/** 创建pinia实例对象 */
const store = createPinia()

store.use(piniaPluginPersistedstate)

/** 安装pinia */
export const setupStore = (app: App): void => {
  app.use(store)
}

export { store }
